<template>
  <el-table :data="tableData" style="width: 100%" max-height="1000px">
    <el-table-column prop="name" label="学校" width="270"> </el-table-column>
    <el-table-column prop="province" label="省份" width="160">
    </el-table-column>
    <el-table-column prop="city" label="市区" width="120"> </el-table-column>
    <el-table-column prop="address" label="地址" width="300"> </el-table-column>
    <el-table-column prop="zip" label="类型" width="120"> </el-table-column>
    <el-table-column fixed="right" label="操作" width="120">
      <template slot-scope="scope">
        <el-button
          @click.native.prevent="deleteRow(scope.$index, tableData)"
          type="text"
          size="small"
        >
          移除
        </el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  methods: {
    deleteRow(index, rows) {
      rows.splice(index, 1);
    }
  },
  data() {
    return {
      tableData: [{
        date: '2016-05-03',
        name: '西南交通大学',
        province: '四川',
        city: '成都',
        address: '四川省成都市高新区西部园区',
        zip: '理工类'
      }, {
        date: '2016-05-02',
        name: '天津科技大学',
        province: '天津',
        city: '河西区',
        address: '天津市河西区大沽南路1038号',
        zip: '理工类'
      }, {
        date: '2016-05-04',
        name: '上海中医药大学',
        province: '上海',
        city: '浦东新区',
        address: '上海市浦东新区蔡伦路1200号',
        zip: '医药类'
      }, {
        date: '2016-05-01',
        name: '合肥工业大学',
        province: '安徽',
        city: '合肥市',
        address: '安徽省合肥市屯溪路193号',
        zip: '理工类'
      }, {
        date: '2016-05-08',
        name: '山东财经大学',
        province: '山东',
        city: '济南市',
        address: '山东省济南市二环东路7366号',
        zip: '财经类'
      }, {
        date: '2016-05-06',
        name: '中央财经大学',
        province: '北京',
        city: '海淀区',
        address: '北京市海淀区学院南路39号',
        zip: '财经类'
      }, {
        date: '2016-05-07',
        name: '国防科技大学',
        province: '湖南',
        city: '长沙市',
        address: '湖南省长沙市开福区',
        zip: '军事类'
      }]
    }
  }
}
</script>